package cn.itrip.dao.mapper;

import cn.itrip.beans.pojo.ItripUser;
import org.apache.ibatis.annotations.Param;


public interface ItripUserMapper {

    int deleteByPrimaryKey(Long id)throws Exception;

    /**
     * 登录
     * @return
     */
    ItripUser selectByLogin(@Param("userCode") String userCode,@Param("userPassword") String userPassword)throws Exception;

    /**
     * 判断该userCode是否已被注册
     * @param userCode
     * @return
     */
    ItripUser selectByUserCode(@Param("userCode") String userCode)throws  Exception;
    /**
     * 注册
     * @param record
     * @return
     * @throws Exception
     */
    int insert(ItripUser record)throws Exception;

    int insertSelective(ItripUser record)throws Exception;

    /**
     * 根据主键查询
     * @param id
     * @return
     * @throws Exception
     */
    ItripUser selectByPrimaryKey(@Param("id") Long id)throws Exception;

    /**
     * 修改状态信息
     * 激活用户
     * @param userCode
     * @return
     * @throws Exception
     */
    int updateActivated(@Param("userCode") String userCode)throws Exception;

    int updateByPrimaryKeySelective(ItripUser record)throws Exception;
    /**
     * 根据主键修改
     * @param record
     * @return
     * @throws Exception
     */
    int updateByPrimaryKey(ItripUser record)throws Exception;
}